package permission

import (
	"context"

	v1 "gitee.com/liangziyisheng/caas-platform-mc/api/permission/v1"
	"gitee.com/liangziyisheng/caas-platform-mc/internal/service"
)

func (c *ControllerV1) Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error) {
	in := &v1.DeleteInput{Id: req.Id}
	out, err := service.Permission().Delete(ctx, in)
	if err != nil {
		return nil, err
	}
	res = &v1.DeleteRes{Rows: out.Rows}
	return res, nil
}
